/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sql;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

/**
 *
 * @author 马凯
 */
public class SELECT_SQL {
    private static SELECT_SQL s;
    
    public static SELECT_SQL getInstance(){
        if(s==null){
            s = new SELECT_SQL();
        }
        return s;
    }
    
    public ResultSet run(String sqlQuery){
        try {
            Class.forName("com.mysql.jdbc.Driver");
            Connection con = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/isc?user=root&password=root");
            con.setCatalog("isc");
            Statement statement = con.createStatement();

            ResultSet test = statement.executeQuery(sqlQuery);
            return test;
        }catch(Exception e){e.printStackTrace();return null;}
    }
}
